import { axios } from "@/utils/request";
import { baseUrl } from "@/services/baseUrl";

//工程建设许可-动态表头
export function getPermitHeader(data) {
  return axios({
    url: baseUrl + `/probusiness/engineeringConstructionPermit/getTableHead`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//工程建设许可-列表数据
export function pagePermitBody(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/engineeringConstructionPermit/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//工程建设许可-保存
export function savePermit(data) {
  return axios({
    url: baseUrl + `/probusiness/engineeringConstructionPermit/updateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//工程建设许可-【新增详情】
export function getPermitConfigField(data = {}) {
  return axios({
    url: baseUrl + `/probusiness/engineeringConstructionPermit/initConfigField`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//工程建设许可-【删除】
export function deletePermit(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/engineeringConstructionPermit/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//工程建设许可-详情
export function detailPermit(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/engineeringConstructionPermit/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//工程建设许可一级目录-下载压缩包
export function exportPermit(data) {
  let { classifyId, uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/engineeringConstructionPermit/exportZip?classifyId=${classifyId}&uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    data: {},
  });
}
//工程建设许可一级目录-普通文件压缩包
export function exportZipByFileIds(data) {
  return axios({
    url: baseUrl + `/probusiness/designBriefing/exportZipByFileIds`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    data,
  });
}

//场地管理-分页
export function pageVenueManage(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologySite/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//施工样板管理-分页
export function pageSampleManage(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyConstructionSample/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//开工准备-分页
export function pageStartPrepare(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyOperatingReserves/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//开工准备-保存
export function saveStartPrepare(data) {
  return axios({
    url: baseUrl + `/probusiness/technologyOperatingReserves/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//开工准备-详情
export function detailStartPrepare(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyOperatingReserves/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//开工准备-【删除】
export function deleteStartPrepare(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyOperatingReserves/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//开工准备-【提交】
export function submitStartPrepare(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyOperatingReserves/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//开工准备-审批
export function approveStartPrepare(data) {
  return axios({
    url: baseUrl + `/probusiness/technologyOperatingReserves/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//方案审核-分页
export function pageProgrammeExamine(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyConstructionPlanReview/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//方案审核-【提交】
export function submitProgrammeExamine(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyConstructionPlanReview/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//方案审核-【删除】
export function deleteProgrammeExamine(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyConstructionPlanReview/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//方案审核-审批
export function approveProgrammeExamine(data) {
  return axios({
    url: baseUrl + `/probusiness/technologyConstructionPlanReview/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//方案审核-保存
export function saveProgrammeExamine(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyConstructionPlanReview/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//方案审核-详情
export function detailProgrammeExamine(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/technologyConstructionPlanReview/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
